﻿//  Copyright (c) 2011 Ray Liang (http://www.dotnetage.com)
//  Licensed MIT: http://www.opensource.org/licenses/mit-license.php

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DNA.Mvc
{
    /// <summary>
    /// Present the observer base class that process the event when Event type has been matched.
    /// </summary>
    /// <typeparam name="TEvent"></typeparam>
    public abstract class EventTypebaseObserver<TEvent> : EventObserver
    where TEvent : EventBase
    {
        public abstract void Process(TEvent e);

        protected override void ProcessEvent(EventBase value)
        {
            var e = value as TEvent;
            if (e != null)
                Process(e);
        }
    }
}
